import reshandler from 'services/response-handler'
/*
 * 用户信息
 */
function makeData(response) {
  return Object.assign({},response, {
    "userName": response.userName || "",
    "userMobile": response.userMobile || "",
    "userGender": response.userGender || "",
    "headerUrl": response.headerUrl || "",
    "point": response.point || "0",
    "bean": response.bean || "0",
    "userNickname": response.userNickname || "",
    "birthday": response.birthday || "",
    "qq": response.qq || "",
    "wchat": response.wchat || "",
    "email": response.email || "",
    "personId": response.personId || "",
    "realName": response.realName || "",
    "location": response.location || "",
    "showName": response.showName || "",
    "qrCode": response.qrCode || "",
    "rank": response.rank || "",
    "maintain": response.maintain || "",
    "insurance": response.insurance || "",
    "annualInspect": response.annualInspect || "",
    "motCarId": response.motCarId || "",
    "hasSetPassword": response.hasSetPassword || "0",
    "hasSetPayPassword": response.hasSetPayPassword || "0",
    "defaultCarId": response.defaultCarId || "",
    "plateNumber": response.plateNumber || "",
    "shopContinueSignDays": response.shopContinueSignDays || "0",
    "signInState": response.signInState || "0"
  })
}
export default function (params, success, fail) {
  // request 
  params = Object.assign({}, params, {
    methodName: "QueryUserInfo",
  })

  // invoke
  this.$.get(params)
    .then(reshandler.success(success, fail, makeData), reshandler.error(fail))
}
